package test.ui {
	import gear.core.Game;
	import gear.net.LibData;
	import gear.net.RESManager;
	import gear.net.SWFLoader;
	import gear.ui.cell.LabelSource;
	import gear.ui.controls.GSelector;
	import gear.ui.data.GLabelData;
	import gear.ui.data.GSelectorData;

	import flash.events.Event;

	/**
	 * TestGSelector 测试选择器控件
	 * 
	 * @author bright
	 * @version 20101022
	 */
	[SWF(width=1000,height=570,backgroundColor=0x333333,frameRate=48)]
	public class TestGSelector extends Game {
		override protected function startup() : void {
			RESManager.instance.add(new SWFLoader(new LibData("assets/ui.swf")));
			RESManager.instance.addEventListener(Event.COMPLETE, completeHandler);
			RESManager.instance.load();
		}

		private function completeHandler(event : Event) : void {
			var data : GSelectorData = new GSelectorData();
			data.x = 10;
			data.y = 10;
			data.width = 160;
			data.labelData.text = "游戏模式:";
			var labelData : GLabelData = new GLabelData();
			data.componentData = labelData;
			var mode_sr : GSelector = new GSelector(data);
			mode_sr.model.source = [new LabelSource("配队模式", 0), new LabelSource("训练模式", 1)];
			mode_sr.selectionModel.index = 1;
			addChild(mode_sr);
		}

		public function TestGSelector() {
			super();
		}
	}
}
